home *** CD-ROM | disk | FTP | other *** search
/ PCMania 83 / PCMania CD83_1.iso / dia.dir / 00006_CambiaDia.ls < prev    next >
Encoding:
Text File  |  1999-05-05  |  2.8 KB  |  101 lines

  1. property pLinea, pSlider
  2. global gLinea, gSlider, ValorDia, VMesA
  3.  
  4. on getPropertyDescriptionList
  5.   if the currentSpriteNum = 0 then
  6.     set memdefault to 0
  7.   else
  8.     set memref to the member of sprite the currentSpriteNum
  9.     set castLibNum to the castLibNum of memref
  10.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  11.   end if
  12.   set description2 to [:]
  13.   addProp(description2, #pSlider, [#default: 59, #format: #integer, #comment: "Slider:"])
  14.   return description2
  15. end
  16.  
  17. on beginSprite me
  18.   set gSlider to pSlider
  19.   set the constraint of sprite gSlider to gLinea
  20. end
  21.  
  22. on mouseDown me
  23.   global vSlider1, ValorT, Valor, MESPrite, ValorDia, Lmes, VMes1, VMes2, VMes3
  24.   puppetSprite(MESPrite, 0)
  25.   cursor([71, 72])
  26.   set the constraint of sprite gSlider to gLinea
  27.   set vBottom1 to the bottom of sprite gSlider
  28.   set vTop1 to the top of sprite gLinea
  29.   repeat while the stillDown
  30.     set the locV of sprite gSlider to the mouseV
  31.     set Valor to the locV of sprite gSlider
  32.     updateStage()
  33.   end repeat
  34.   set Valor to integer(Valor)
  35.   if Valor < 13 then
  36.     set Valor to 13
  37.   end if
  38.   set ValorT to integer(Valor / 13)
  39.   set VMes1 to getAt(Lmes, ValorT) - Valor
  40.   if ValorT = 1 then
  41.     nothing()
  42.   else
  43.     set VMes2 to getAt(Lmes, ValorT - 1) - Valor
  44.   end if
  45.   set VMes3 to getAt(Lmes, ValorT + 1) - Valor
  46.   if (abs(VMes1) <= abs(VMes2)) and (abs(VMes1) < abs(VMes3)) then
  47.     set ValorT to ValorT
  48.   end if
  49.   if (abs(VMes2) < abs(VMes1)) and (abs(VMes2) < abs(VMes3)) then
  50.     set ValorT to ValorT - 1
  51.   end if
  52.   if (abs(VMes3) < abs(VMes2)) and (abs(VMes3) < abs(VMes1)) then
  53.     set ValorT to ValorT + 1
  54.   end if
  55.   if ValorDia <> ValorT then
  56.     set the locV of sprite gSlider to getAt(Lmes, ValorT) + 2
  57.     set MESPrite to ValorT + 10
  58.     set the memberNum of sprite MESPrite to the memberNum of sprite MESPrite + 1
  59.     updateStage()
  60.     if ValorT < 1 then
  61.       set ValorT to 1
  62.     end if
  63.     if ValorT > 31 then
  64.       set ValorT to 31
  65.     end if
  66.     if (ValorT > 28) and (VMesA = 2) then
  67.       set ValorT to 28
  68.     end if
  69.     set ValorDia to ValorT
  70.     tell the stage
  71.       BuscaDia(ValorDia)
  72.     end tell
  73.   else
  74.     set the locV of sprite gSlider to getAt(Lmes, ValorT) + 2
  75.     set MESPrite to ValorT + 10
  76.     puppetSprite(MESPrite, 0)
  77.     set ValorDia to ValorT
  78.     updateStage()
  79.   end if
  80. end
  81.  
  82. on mouseUp me
  83. end
  84.  
  85. on mouseEnter me
  86.   cursor([71, 72])
  87.   set the memberNum of sprite the currentSpriteNum to the memberNum of sprite the currentSpriteNum + 1
  88. end
  89.  
  90. on mouseLeave me
  91.   cursor(-1)
  92.   set the memberNum of sprite the currentSpriteNum to the memberNum of sprite the currentSpriteNum - 1
  93. end
  94.  
  95. on mouseUpOutSide me
  96. end
  97.  
  98. on getBehaviorDescription
  99.   return "Para controlar  la Barra de los Dias. AFC" & RETURN & "P.D:" & RETURN & "Al que lo copie que pregunte por que tiene  m├ís de un truco:-)" & RETURN
  100. end
  101.